<%--Created by IntelliJ IDEA.
User: admin
Date: 2017/4/12
Time: 10:48
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%--解析表达式--%>
<%@ page isELIgnored="false" %>
<%--引入jstl--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%--引入springMVC form--%>
<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <!-- Basic -->
    <meta charset="UTF-8"/>
    <title>编辑项目</title>
    <script type="application/javascript">
        function go() {
            if ('${project.projectId }' != 0) {
                document.getElementById("projectForm").action = "${pageContext.request.contextPath}/Project/updateProject.emp";
            }
        }
        function ToempShowPage() {
            window.location.href = "${pageContext.request.contextPath}/Project/selProjectAll.emp";
        }
        window.onload = function () {
            var projectForm = document.getElementById("projectForm");
            if ('${msg}' == '添加成功' || '${msg}' == '修改成功') window.location.href = "${pageContext.request.contextPath}/Project/selProjectAll.emp";
            if ('${plan.planId }' != 0) {
                projectForm.action = "${pageContext.request.contextPath}/Project/updateProject.emp";
            }
        }
    </script>
</head>
<body>
<!--头部开始-->
<jsp:include page="headerBack.jsp"></jsp:include>
<!-- 导航 -->
<jsp:include page="leftBack.jsp"></jsp:include>
<!--内容页-->
<div class="main">
    <!--内容页头部-->
    <div class="page-header">
        <div class="pull-left">
            <ol class="breadcrumb visible-sm visible-md visible-lg">
                <li><a href="${pageContext.request.contextPath}/Login/goHomePage"><i class="icon fa fa-home"></i>主页</a></li>
                <li class="active"><i class="fa fa-pencil"></i>基本信息</li>
            </ol>
        </div>
        <div class="pull-right">
            <h2>主页</h2>
        </div>
    </div>
    <!-- End Page Header -->
    <div class="row profile">
        <div class="col-lg-11">
            <div class="col-lg-7 col-md-9 col-sm-12">
                <div class="panel">
                    <div class="panel-body">
                        <div class="tabs tabs-warning">
                            <ul class="nav nav-tabs">
                                <li class="active">
                                    <a href="#edit" data-toggle="tab">编辑信息</a>
                                </li>
                            </ul>
                            <div class="tab-content">
                                <div id="edit" class="tab-pane updateProfile active">
                                    <!--form表单-->
                                    <sf:form class="form-horizontal"
                                             action="${pageContext.request.contextPath}/Project/addProject.emp"
                                             modelAttribute="project" id="projectForm" method="post">
                                        <div class="bk-bg-white bk-padding-top-10 bk-padding-bottom-10">
                                            <h4>项目基本信息</h4>
                                            <fieldset>
                                                <div>
                                                    <sf:input id="projectId" path="projectId" type="hidden"/>
                                                </div>

                                                <div class="form-group">
                                                    <label>项目名称</label>
                                                    <sf:input type="text" class="form-control" path="projectName"/>
                                                    <span style="color: #ba0000"> ${errors.projectName} </span>
                                                </div>
                                                <div class="form-group">
                                                    <label>项目描述</label>
                                                    <sf:input type="text" class="form-control" path="projectDescribe"/>
                                                </div>
                                                <div class="form-group">
                                                    <label>负责人</label>
                                                    <sf:select path="projectOfficial"  class="form-control">
                                                        <c:forEach var="e" items="${empList}">
                                                            <sf:option value="${e.empId}">${e.empName}</sf:option>
                                                        </c:forEach>
                                                    </sf:select>
                                                    <span style="color: #ba0000"> ${errors.projectOfficial} </span>
                                                </div>
                                                <div class="form-group">
                                                    <label>审核人</label>
                                                    <sf:select path="projectAudit"  class="form-control">
                                                        <c:forEach var="e" items="${empList}">
                                                            <sf:option value="${e.empId}">${e.empName}</sf:option>
                                                        </c:forEach>
                                                    </sf:select>
                                                </div>
                                            </fieldset>
                                            <div class="bk-bg-white">
                                                <div class="row">
                                                    <div class="col-md-12">
                                                        <div class="pull-right">

                                                            <button onclick="go()" type="submit"
                                                                    class="btn btn-primary">提交
                                                            </button>
                                                            &nbsp;&nbsp;
                                                            <button type="button" onclick="ToempShowPage()"
                                                                    class="btn btn-primary">取消
                                                            </button>

                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </sf:form>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript" src="${pageContext.request.contextPath}/dist/backEnd/js/datetime.js"></script>
</body>
</html>